class AcceptanceForm {
  String formNumber;
  DateTime acceptanceDate;
  String applicantName;
  String applicantPhone;
  String applicantIdCard;
  String respondentName;
  String respondentPhone;
  String respondentIdCard;
  String disputeDescription;
  String acceptorName;
  String acceptorUnit;
  String acceptorPhone;
  int categoryId;
  int status;

  AcceptanceForm({
    required this.formNumber,
    required this.acceptanceDate,
    required this.applicantName,
    required this.applicantPhone,
    required this.applicantIdCard,
    required this.respondentName,
    required this.respondentPhone,
    required this.respondentIdCard,
    required this.disputeDescription,
    required this.acceptorName,
    required this.acceptorUnit,
    required this.acceptorPhone,
    required this.categoryId,
    required this.status,
  });

  Map<String, dynamic> toJson() {
    return {
      'form_number': formNumber,
      'acceptance_date': acceptanceDate.toIso8601String(),
      'applicant_name': applicantName,
      'applicant_phone': applicantPhone,
      'applicant_id_card': applicantIdCard,
      'respondent_name': respondentName,
      'respondent_phone': respondentPhone,
      'respondent_id_card': respondentIdCard,
      'dispute_description': disputeDescription,
      'acceptor_name': acceptorName,
      'acceptor_unit': acceptorUnit,
      'acceptor_phone': acceptorPhone,
      'category_id': categoryId,
      'status': status,
    };
  }

  factory AcceptanceForm.fromJson(Map<String, dynamic> json) {
    return AcceptanceForm(
      formNumber: json['form_number'] as String,
      acceptanceDate: DateTime.parse(json['acceptance_date'] as String),
      applicantName: json['applicant_name'] as String,
      applicantPhone: json['applicant_phone'] as String,
      applicantIdCard: json['applicant_id_card'] as String,
      respondentName: json['respondent_name'] as String,
      respondentPhone: json['respondent_phone'] as String,
      respondentIdCard: json['respondent_id_card'] as String,
      disputeDescription: json['dispute_description'] as String,
      acceptorName: json['acceptor_name'] as String,
      acceptorUnit: json['acceptor_unit'] as String,
      acceptorPhone: json['acceptor_phone'] as String,
      categoryId: json['category_id'] as int,
      status: json['status'] as int,
    );
  }
} 